Skip to content

Extract MCP::Annotations into a dedicated file#224

Merged
koic merged 1 commit intomodelcontextprotocol:mainfrom
koic:extract_annotations_from_mcp
Feb 9, 2026
Merged

Extract MCP::Annotations into a dedicated file#224
koic merged 1 commit intomodelcontextprotocol:mainfrom
koic:extract_annotations_from_mcp

Conversation

@koic
Copy link
Member

@koic koic commented Feb 3, 2026

Motivation and Context

This PR moves MCP::Annotations from lib/mcp.rb to lib/mcp/annotations.rb for better organization, following the pattern used for other classes such as Tool::Annotations.

This PR also adds the missing last_modified attribute to MCP::Annotations: https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/2025-11-25/schema.ts#L1701-L1736

It also adds a to_h method for serialization and includes comprehensive test coverage.

How Has This Been Tested?

Added comprehensive tests to verify the fix and prevent regression.

Breaking Changes

None. This code is unused within the ruby-sdk repository, but it is kept for compatibility, as it may be used by users.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

This PR moves `MCP::Annotations` from lib/mcp.rb to lib/mcp/annotations.rb for better organization,
following the pattern used for other classes such as `Tool::Annotations`.

This PR also adds the missing `last_modified` attribute to `MCP::Annotations`:
https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/2025-11-25/schema.ts#L1701-L1736

It also adds a `to_h` method for serialization and includes comprehensive test coverage.

NOTE: This code is unused within the ruby-sdk repository, but it is kept for compatibility, as it may be used by users.
@koic koic merged commit c11393f into modelcontextprotocol:main Feb 9, 2026
10 checks passed
@koic koic deleted the extract_annotations_from_mcp branch February 9, 2026 17:30
@koic koic mentioned this pull request Feb 14, 2026
5 tasks
koic added a commit that referenced this pull request Feb 14, 2026
Some new features and fixes have been added, and it seems like a good time to cut a release.

- #103
- #223
- #218
- #221
- #225
- #224
- #220

For now, the features completed so far can be included in this release,
and subsequent feature proposals can continue to be incorporated into future releases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants